package com.etlmaster.executor.processors.File;

import java.io.Serializable;



/**
 * 文件传输的统计信息
 * @author Larry
 * @copyright Larry@etlMaster
 * @since 2017-09-10
 */
public class FileTransInfo  implements Serializable{
	
	private long sourceFileSize;
	private long transFileSize;
	private long rowNum=-1;
	private String sourceVfsURI;
	private String targetVfsURI;
	private long transDura;
	private boolean isAppend=false;
	private boolean isRowRead=false;
	private boolean isNeedChangeCharset=false;
	private String sourceCharSet="UTF-8";
	private String targetCharSet="UTF-8";
	private String startRowNum="1";
	private String rowProcessScript;//行处理方法
	
	private boolean deCompress;//是否自动解压
	
	private boolean keepBack;//是否保留压缩文件

	public boolean isDeCompress() {
		return deCompress;
	}

	public void setDeCompress(boolean deCompress) {
		this.deCompress = deCompress;
	}

	public boolean isKeepBack() {
		return keepBack;
	}

	public void setKeepBack(boolean keepBack) {
		this.keepBack = keepBack;
	}
	private String splitType;
	private long splitSize;
	private int splitRowNum;
	private long fileMergeSize;
	
	private boolean isMerged=false;
	public FileTransInfo(String sourceVfsURI,String targetVfsURI){
		this.sourceVfsURI=sourceVfsURI;
		this.targetVfsURI=targetVfsURI;
	}
	public long getSourceFileSize() {
		return sourceFileSize;
	}
	public void setSourceFileSize(long sourceFileSize) {
		this.sourceFileSize = sourceFileSize;
	}
	public long getTransFileSize() {
		return transFileSize;
	}
	public void setTransFileSize(long transFileSize) {
		this.transFileSize = transFileSize;
	}
	public long getRowNum() {
		return rowNum;
	}
	public void setRowNum(long rowNum) {
		this.rowNum = rowNum;
	}
	public String getSourceVfsURI() {
		return sourceVfsURI;
	}
	public void setSourceVfsURI(String sourceVfsURI) {
		this.sourceVfsURI = sourceVfsURI;
	}
	public String getTargetVfsURI() {
		return targetVfsURI;
	}
	public void setTargetVfsURI(String targetVfsURI) {
		this.targetVfsURI = targetVfsURI;
	}
	public long getTransDura() {
		return transDura;
	}
	public void setTransDura(long transDura) {
		this.transDura = transDura;
	}
	public boolean isAppend() {
		return isAppend;
	}
	public void setAppend(boolean isAppend) {
		this.isAppend = isAppend;
	}
	public boolean isRowRead() {
		return isRowRead;
	}
	public void setRowRead(boolean isRowRead) {
		this.isRowRead = isRowRead;
	}
	public boolean isNeedChangeCharset() {
		return isNeedChangeCharset;
	}
	public void setNeedChangeCharset(boolean isNeedChangeCharset) {
		this.isNeedChangeCharset = isNeedChangeCharset;
	}
	public String getSourceCharSet() {
		return sourceCharSet;
	}
	public void setSourceCharSet(String sourceCharSet) {
		this.sourceCharSet = sourceCharSet;
	}
	public String getTargetCharSet() {
		return targetCharSet;
	}
	public void setTargetCharSet(String targetCharSet) {
		this.targetCharSet = targetCharSet;
	}
	public String getStartRowNum() {
		return startRowNum;
	}
	public void setStartRowNum(String startRowNum) {
		this.startRowNum = startRowNum;
	}
	public String getRowProcessScript() {
		return rowProcessScript;
	}
	public void setRowProcessScript(String rowProcessScript) {
		this.rowProcessScript = rowProcessScript;
	}
	public String getSplitType() {
		return splitType;
	}
	public void setSplitType(String splitType) {
		this.splitType = splitType;
	}
	public int getSplitRowNum() {
		return splitRowNum;
	}
	public void setSplitRowNum(int splitRowNum) {
		this.splitRowNum = splitRowNum;
	}
	public long getSplitSize() {
		return splitSize;
	}
	public void setSplitSize(long splitSize) {
		this.splitSize = splitSize;
	}
	public long getFileMergeSize() {
		if(fileMergeSize!=0)
			return fileMergeSize;
		else
			return 128*1024*1024;
	}
	public void setFileMergeSize(long fileMergeSize) {
		this.fileMergeSize = fileMergeSize;
	}

	public boolean isMerged() {
		return isMerged;
	}

	public void setMerged(boolean isMerged) {
		this.isMerged = isMerged;
	}
}
